package mybatis.web;

import java.io.IOException;
import java.util.List;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import javafx.application.Application;
import mybatis.entity.Type;
import mybatis.service.TypeService;
import mybatis.service.impl.GamesServiceImpl;
import mybatis.service.impl.TypeServiceImpl;

/**
 * Servlet implementation class TypeServlet
 */
@WebServlet("/type/*")
public class TypeServlet extends BaseServlet {
	private TypeService service;
	{
		service = applicationContext.getBean("typeServiceImpl",TypeServiceImpl.class);
	}
	public void getTypes(HttpServletRequest request, HttpServletResponse response) {
		List<Type> list = service.getTypes();
		try {
			responseJson(response,list);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}


}
